package com.knight.mall.admin.exception;

import com.knight.mall.admin.web.utils.MallApiResponseCodeEnum;
import com.knight.mall.admin.web.utils.MallrApiResponseCode;
import com.knight.mall.exception.ServiceException;

public class WebException extends ServiceException {

	private static final long serialVersionUID = 358356609308978512L;

	private int code = MallrApiResponseCode._1000002.getCode();

	public WebException(MallApiResponseCodeEnum codeEnum, Object... args) {
		this(String.format(codeEnum.getMsg(), args));
		this.code = codeEnum.getCode();
	}

	public WebException(String message) {
		super(message);
	}

	public WebException(int code, String message) {
		super(message);
		this.code = code;
	}

	public int getCode() {
		return code;
	}
}
